package com.zr.spring.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;

public class MyPublisher {

    @Autowired
    public ApplicationContext context;

    public void publishEvent(ApplicationEvent event) {
        System.out.println("---发布事件---");
        context.publishEvent(event);
    }
}
